﻿using MiniFox.Components;
using System.Net.Mail;

namespace MiniFox.Mail
{
    /// <summary>
    /// 
    /// </summary>
    [AutoRegister, SpareComponent(typeof(MailService))]
    public interface IMailService
    {
        /// <summary>
        /// 
        /// </summary>
        bool EnableAsync { get; }
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<MailErrorEventArgs> MailError;
        /// <summary>
        /// 
        /// </summary>
        event EventHandler<MailSentEventArgs> MailSent;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="toList"></param>
        /// <param name="ccList"></param>
        /// <param name="attachments"></param>
        void SendMail(string title, string body, bool isHtmlBody, IEnumerable<MailAddress> toList, IEnumerable<MailAddress> ccList, params Attachment[] attachments);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        void SendMail(string title, string body, bool isHtmlBody, string[] to);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        /// <param name="cc"></param>
        void SendMail(string title, string body, bool isHtmlBody, string[] to, string[] cc);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        /// <param name="cc"></param>
        /// <param name="attachments"></param>
        void SendMail(string title, string body, bool isHtmlBody, string[] to, string[] cc, params Attachment[] attachments);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="to"></param>
        void SendMail(string title, string body, string[] to);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="toList"></param>
        /// <param name="ccList"></param>
        /// <param name="attachments"></param>
        /// <returns></returns>
        Task SendMailAsync(string title, string body, bool isHtmlBody, IEnumerable<MailAddress> toList, IEnumerable<MailAddress> ccList, params Attachment[] attachments);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        Task SendMailAsync(string title, string body, bool isHtmlBody, string[] to);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        /// <param name="cc"></param>
        /// <returns></returns>
        Task SendMailAsync(string title, string body, bool isHtmlBody, string[] to, string[] cc);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="isHtmlBody"></param>
        /// <param name="to"></param>
        /// <param name="cc"></param>
        /// <param name="attachments"></param>
        /// <returns></returns>
        Task SendMailAsync(string title, string body, bool isHtmlBody, string[] to, string[] cc, params Attachment[] attachments);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="title"></param>
        /// <param name="body"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        Task SendMailAsync(string title, string body, string[] to);
    }
}